/*
 * File : examRecord.js
 * Version : 0.1
 * Description : 针对检查结果模块所做的一系列js处理
 * Author : hxin
 * Created :2011/8/4
 * 
 */
$(document).ready(function(){
	$.getJSON("exam-record!checkExamRecord.action",{id:0},function(json){
		//输出返回的json数据
		$("#examRecord").html("");
		$.each(json,function(i){
			$("#examRecord").append(
			"<tr>"+
			"<td>"+json[i].item.term+"</td>"+
			"<td>"+json[i].qualitation+"</td>"+ 
			"<td>"+json[i].examResult+"</td>"+
			"<td>"+json[i].unit+"</td>"+
			"<td>"+json[i].explanation+"</td>"+
			"<td>"+json[i].referenceStandard+"</td>"+
			"<td>"+"<a href='#' onclick='deleteExamRecord("+json[i].id+")'>"+"删除"+"</a>"+"</td>"+
			"</tr>"
			);	
		});
	});
});

//删除检查结果记录
function deleteExamRecord(id) {
	$.getJSON("exam-record!delete.action",{id:id},function(json){
		//输出返回的json数据
		$("#examRecord").html("");
		$.each(json,function(i){
			$("#examRecord").append(
			"<tr>"+
			"<td>"+json[i].item.term+"</td>"+
			"<td>"+json[i].qualitation+"</td>"+ 
			"<td>"+json[i].examResult+"</td>"+
			"<td>"+json[i].unit+"</td>"+
			"<td>"+json[i].explanation+"</td>"+
			"<td>"+json[i].referenceStandard+"</td>"+
			"<td>"+"<a href='' onclick='deleteExamRecord("+json[i].id+")'>"+"删除"+"</a>"+"</td>"+
			"</tr>"
			);	
		});		
	});
}
